#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
void _strcpy(char now[],char old[],int l,int r){
    for(int i=l;i<=r;i++){
        now[i-l]=old[i];
    }
    now[r-l+1]='\0';
}
void define_del_beginandend(char letter[]){
    int l=0,r=strlen(letter)-1;
    while(letter[l]==' ')l++;
    while(letter[r]==' ')r--;
    _strcpy(letter,letter,l,r);
    return;
}
void define_del_mid(char letter[]){
    int t=0,l=0,r=0;string out;
    for(int i=0;i<strlen(letter);i++){
        if(letter[i]!=' ') out+=letter[i];
        if(letter[i]==' '){
            out+=' ';
            while(letter[i+1]==' ')i++;
        }
    }
    strcpy(letter,out.c_str());
}
int main(){
    char letter[]="   yf(a==b)  yrsays(\"aha\") yr";
    define_del_beginandend(letter);
    define_del_mid(letter);
    cout<<"*"<<letter<<"*";
    return 0;
}